package chuangya.com.anmi.adapter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import java.util.List;

import RecycleViewUtil.SunStartBaseAdapter;
import RecycleViewUtil.ViewHolder;
import chuangya.com.anmi.R;
import chuangya.com.anmi.databean.MainInnerTitleBean;

/**
 * Created by Sun.Star on 2017/6/23.
 */

public class MainInnerTitleAdapter extends SunStartBaseAdapter {
    public MainInnerTitleAdapter(Context context, List<?> list) {
        super(context, list);
    }

    @Override
    public int onCreateViewLayoutID(int viewType) {
        return R.layout.main_inner_title_item;
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {
        MainInnerTitleBean bean = (MainInnerTitleBean) list.get(position);
        TextView tv = holder.getTextView(R.id.inner_title_text);
        ImageView iv = holder.getImageView(R.id.inner_title_indecator);
        tv.setText(bean.getName());
        if(bean.isCheck()){
            iv.setVisibility(View.VISIBLE);
            tv.setTextColor(context.getResources().getColor(R.color.colorAccent));
        }else{
            iv.setVisibility(View.INVISIBLE);
            tv.setTextColor(context.getResources().getColor(R.color.textBlcak));
        }

    }
}
